#include "mainwindow.h"

void MainWindow::drownHline(int n,QFrame **frame,int x,int y,int weight,int height,int distance)
{
    for(int i=0;i<n;i++)
    {
        frame[i]=new QFrame(ui->centralWidget);
        frame[i]->setGeometry(x,y+i*distance,weight,height);
        frame[i]->setFrameShape(QFrame::HLine);
        frame[i]->setLineWidth(weight);
    }
}

void MainWindow::drownHline(int n,QFrame **frame,int x,int y,int weight,int height,int distance,int shift)
{
    for(int i=0;i<n;i++)
    {
        frame[i]=new QFrame(ui->centralWidget);
        frame[i]->setGeometry(x,y+i*distance,weight+i*shift,height);
        frame[i]->setFrameShape(QFrame::HLine);
        frame[i]->setLineWidth(weight);
    }
}

void MainWindow::drownHline(int n,QFrame **frame,int x,int y,int weight,int height,int distance,int xshift,int shift)
{
    for(int i=0;i<n;i++)
    {
        frame[i]=new QFrame(ui->centralWidget);
        frame[i]->setGeometry(x+i*xshift,y+i*distance,weight+i*shift,height);
        frame[i]->setFrameShape(QFrame::HLine);
        frame[i]->setLineWidth(weight);
    }
}

void MainWindow::drownVline(int n,QFrame **frame,int x,int y,int weight,int height,int distance,int yshift,int shift)
{
    for(int i=0;i<n;i++)
    {
        frame[i]=new QFrame(ui->centralWidget);
        frame[i]->setGeometry(x+i*distance,y+i*yshift,weight,height+i*shift);
        frame[i]->setFrameShape(QFrame::VLine);
        frame[i]->setLineWidth(height);
    }
}

void MainWindow::drowNCheckBox(int n,QCheckBox **checkbox,int x,int y,int weight,int height,int distance)
{
    for(int i=0;i<n;i++)
    {
        checkbox[i]=new QCheckBox;
        checkbox[i]->setParent(ui->centralWidget);
        checkbox[i]->setGeometry(x,y+i*distance,weight,height);
    }
}

void MainWindow::drowNCheckBox(int n,int N,QCheckBox **checkbox,int x,int y,int weight,int height,int distance,int delta)
{
    for(int i=0;i<n;i++)
    {
        checkbox[i]=new QCheckBox;
        checkbox[i]->setParent(ui->centralWidget);
        checkbox[i]->setGeometry(x,y+i*distance+(int)(i/N)*(delta-distance*N),weight,height);
    }
}

void MainWindow::drowNWord(int n,QLabel **label,int x,int y,int weight,int height,int distance)
{
    for(int i=0;i<n;i++)
    {
        label[i]=new QLabel;
        label[i]->setParent(ui->centralWidget);
        label[i]->setGeometry(x,y+i*distance,weight,height);
    }
}

void MainWindow::drowNImage(int n,QLabel **label,int x,int y,int weight,int height,int distance)
{
    for(int i=0;i<n;i++)
    {
        label[i]=new QLabel;
        label[i]->setParent(ui->centralWidget);
        label[i]->setGeometry(x,y+i*distance,weight,height);
        label[i]->setPixmap(QPixmap::fromImage(*im));
    }
}

void MainWindow::drowNImage2(int n,QLabel **label,int x,int y,int weight,int height,int distance)
{
    for(int i=0;i<n;i++)
    {
        label[i]=new QLabel;
        label[i]->setParent(ui->centralWidget);
        label[i]->setGeometry(x,y+i*distance,weight,height);
        label[i]->setPixmap(QPixmap::fromImage(*im2));
    }
}
